package com.chenshuang.dao;

import com.chenshuang.bean.CartGoods;
import com.chenshuang.bean.Goods;
import com.chenshuang.bean.Goods;

public class CartGoodsDao extends BasicDao<Goods> {

    public CartGoods queryGoods(String id, CartGoods cartgoods) {
        Goods virGoods = querySingle("select * from goods where id = ?", Goods.class, id);
        cartgoods.setGoods(virGoods);
        return cartgoods;
    }

    public Goods queryGoods1(String id) {
        return querySingle("select * from goods where id = ?",Goods.class, id);
    }

//    private Goods querySingle(String sql, Class<Goods> goodsClass, String id) {
//        try {
//            return r.query(JDBCTools.getConnection(), sql, new BeanHandler<>(goodsClass), id);
//        } catch (SQLException e) {
//            throw new RuntimeException(e);
//        }
//    }
}
